package com.winning.cqs.pregnantbabycare_cqs_v1.proxy;

import android.content.Context;
import android.os.Handler;

public class QsActivityProxy {
	private QsToastProxy mToastProxy = null;

	private QsDialogProxy mDialogProxy = null;

	private Context mContext;

	private Handler mHandler = new Handler();

	public QsActivityProxy(Context context) {
		mContext = context;
	}

	public void onDestroy() {
		// if (mDialogProxy != null)
		// {
		// mDialogProxy.cancelMsgDialog();
		// mDialogProxy.cancelProgressDialog();
		// }
	}

	/*******************************************************************************
	 * ToastProxy
	 *******************************************************************************/
	public void showToast(final int resourceId) {
		mHandler.post(new Runnable() {
			@Override
			public void run() {
				initToastProxy();
				mToastProxy.showToast(resourceId);
			}
		});
	}

	public void showToast(final String text) {
		mHandler.post(new Runnable() {
			@Override
			public void run() {
				initToastProxy();
				mToastProxy.showToast(text);
			}
		});
	}

	protected void initToastProxy() {
		if (mToastProxy == null) {
			mToastProxy = new QsToastProxy(mContext);
		}
	}

}
